/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package haw.pr2.A2a.implementations;
import haw.pr2.A2a.interfaces.*;
/**
 *
 * @author Fabian Heidorn, Alexander Kaack
 */
public class SpeedInMpS extends AbstractScalar<Speed> implements Speed {
    
    private final double speedInMps;
    
    public SpeedInMpS(double speedInMps) {
        this.speedInMps=speedInMps;
    }

    @Override
    public Speed inverse() {
        return new SpeedInMpS(-this.speedInMps);
    }

    @Override
    public Speed add(Speed value) {
        return new SpeedInMpS(this.speedInMps+value.mpS());
    }

    @Override
    public Speed sub(Speed value) {
        return new SpeedInMpS(this.speedInMps-value.mpS());
    }

    @Override
    public Speed mul(Speed value) {
        return new SpeedInMpS(this.speedInMps*value.mpS());
    }

    @Override
    public Speed div(double value) {
        return new SpeedInMpS(this.speedInMps/value);
    }

    @Override
    public double div(Speed value) {
        return this.mpS()/value.mpS();
    }

    @Override
    public boolean isZero() {
        return this.mpS()==ZERO_SPEED.mpS();
    }

    @Override
    public boolean isValid() {
        return true;
    }

    @Override
    public double mpS() {
        return this.speedInMps;
    }

    @Override
    public double kmH() {
        return this.mpS()*MPS_IN_KMH;
    }

    
}